﻿using System.ComponentModel;
using DevExpress.XtraEditors.DXErrorProvider;
using FluentValidation.Results;
using Dogshow.Win.Helpers;

namespace Dogshow.Win.Models
{

    public class RasaPsa : Model.RasaPsa, IValidatable
    {
        private static readonly Model.Validation.RasaPsaValidator s_Validator = new Model.Validation.RasaPsaValidator();

        public RasaPsa()
        {
        }

        public RasaPsa(Model.RasaPsa rasa) : base(rasa)
        {
        }

        public void GetPropertyError(string propertyName, ErrorInfo info)
        {
            this.GetErrorsForProperty(propertyName, info);
        }

        public void GetError(ErrorInfo info)
        {
            this.GetErrors(info);
        }

        public bool IsValid { get; set; }

        public ValidationResult Validate()
        {
           var r = s_Validator.Validate(this);
            IsValid = r.IsValid;
           return r;
        }


    }
}